package com.seanchenxi.gwt.wordpress.json.service.response;

import java.util.ArrayList;

import com.google.gwt.user.client.rpc.AsyncCallback;
import com.seanchenxi.gwt.wordpress.json.service.model.Post;

public class JsonPostListCallback implements AsyncCallback<PostListResponse> {
	
	private AsyncCallback<ArrayList<Post>> callback;
	
	public JsonPostListCallback(AsyncCallback<ArrayList<Post>> callback){
		this.callback = callback;
	}

	@Override
	public void onFailure(Throwable caught) {
		callback.onFailure(caught);
	}

	@Override
	public void onSuccess(PostListResponse result) {
		callback.onSuccess(result.getResultList());
	}

}